package com.fieldchain.ex.fa100.ui.personal.activity;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.fieldchain.ex.fa100.R;
import com.fieldchain.ex.fa100.base.MyBaseActivity;
import com.fieldchain.ex.fa100.bean.User;
import com.fieldchain.ex.fa100.utils.share.ShareManager;

/**
 * Created by biyunlong
 * Email: 1225198434@qq.com
 * Data:  2018/9/16
 */
public class InviteActivity extends MyBaseActivity implements View.OnClickListener{
    private RelativeLayout reaBack;
    private TextView tvCenter;
    private RelativeLayout reaInvite;
    private RelativeLayout reaDividened;

    private User user;
    private boolean hadAuth = false;

    @Override
    public void findView() {
        reaBack = findViewById(R.id.rea_back);
        tvCenter = findViewById(R.id.tv_center);
        reaInvite = findViewById(R.id.rea_invite);
        reaDividened = findViewById(R.id.rea_dividened);
    }

    @Override
    protected void onResume() {
        super.onResume();
        user = ShareManager.getInstance().getUser();

    }

    @Override
    public void setValue() {
        tvCenter.setText("推广分红");
        reaBack.setOnClickListener(this);
        reaInvite.setOnClickListener(this);
        reaDividened.setOnClickListener(this);
    }

    @Override
    public int getLayout() {
        return R.layout.activity_invite;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rea_back:
                finish();
                break;
            case R.id.rea_invite://邀请好友
                startActivity(new Intent(mContext, InvitationActivity.class));
                break;
            case R.id.rea_dividened:
                startActivity(new Intent(mContext, BonusActivity.class));
                break;
        }
    }
}
